package com.xl.model;

import java.io.Serializable;
import java.util.List;

public class User implements Serializable {  // 实现 Serializable 接口
    private static final long serialVersionUID = 1L;  // 推荐添加版本号

    private int id;
    private String name;
    private int age;
    private List<Order> orders;  // 一对多关系

    // Getters and Setters
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public List<Order> getOrders() {
        return orders;
    }

    public void setOrders(List<Order> orders) {
        this.orders = orders;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
